package org.liveboardgames.agricola.control.delegates
{
    import com.adobe.cairngorm.control.CairngormEventDispatcher;
    
    import flash.utils.setTimeout;
    
    import org.liveboardgames.agricola.control.delegates.harvest.HarvestController;
    import org.liveboardgames.agricola.control.events.StartRoundEvent;
    import org.liveboardgames.agricola.model.AgricolaModelLocator;
    import org.liveboardgames.agricola.vo.Game;
    import org.liveboardgames.agricola.vo.player.Player;
    
    import mx.rpc.IResponder;
    
    public class StartHarvestDelegate
    {
        private var _responder:IResponder;
        
        private var _service:Object;
        
        public function StartHarvestDelegate(responder:IResponder)
        {
            // this.service = ServiceLocator.getInstance().getRemoteObject( "helloWorldService" );
            this._responder = responder;
        }
        
        public function startHarvest(game:Game):void
        {
            setTimeout(startHarvestService, 0, game);
        }
        
        private function startHarvestService(game:Game):void
        {
        	AgricolaModelLocator.getInstance().harvestController = new HarvestController(game);
        	AgricolaModelLocator.getInstance().harvestController.startHarvest();
        }
    }
}